import http from '@/api/http'
import type { APIResult, APIPaging, PaginationParams, InboundConfirmationDTO } from '@/api/types'

export const inboundAPI = {
    getList: (params: PaginationParams): Promise<APIResult<APIPaging<InboundConfirmationDTO>>> => {
        return http.get('/InboundConfirmation/GetPagedList', { params })
    },
    getDetail: (id: string): Promise<APIResult<InboundConfirmationDTO>> => {
        return http.get(`/InboundConfirmation/detail/${id}`)
    },
    create: (data: Omit<InboundConfirmationDTO, 'id'>): Promise<APIResult<string>> => {
        return http.post('/InboundConfirmation/create', data)
    },
    update: (id: string, data: Partial<InboundConfirmationDTO>): Promise<APIResult<void>> => {
        return http.patch(`/InboundConfirmation/update/${id}`, data)
    },
    getByApplicationId: (applicationId: string): Promise<APIResult<InboundConfirmationDTO>> => {
        return http.get(`/InboundConfirmation/by-application/${applicationId}`)
    }
}